import commander, { action, program } from "commander";
import { prompt } from 'inquirer'
import { join } from 'path'
import config from "../config";
import { red, green } from 'chalk'
import Temptlate from "../modules/Template";

/**
 * 获取选取的模板
 * @returns 
 */
export default function (): Promise<Temptlate> {
    return new Promise((resolve, reject) => {
        prompt(config.temptList).then(({ templateInfo }) => {
            // console.log(green('你选择的项目模板:\n'), '****', red(templateInfo.temptName))
            resolve(templateInfo)
        }).catch((error) => {
            reject(error)
        })
    })
}